package com.example.annolog.config;


import com.example.annolog.anno.Log;
import com.example.annolog.interceptor.LogInterceptorInvok;
import groovy.lang.TracingInterceptor;
import org.aopalliance.aop.Advice;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.aop.support.JdkRegexpMethodPointcut;
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
//public class InterceptorAnnotationConfig {
//
//    @Bean
//    public DefaultPointcutAdvisor defaultPointcutAdvisor() {
//        LogInterceptorInvok interceptor = new LogInterceptorInvok();
//
//        //AnnotationMatchingPointcut pointcut = new AnnotationMatchingPointcut(Log.class, true);
//        JdkRegexpMethodPointcut pointcut = new JdkRegexpMethodPointcut();
//        pointcut.setPattern("com.example.annolog.*");
//
//        // 配置增强类advisor
//        DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor();
//        advisor.setPointcut(pointcut);
//        advisor.setAdvice(interceptor);
//        return advisor;
//    }
//
//}